<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{:C('WEB_SITE_TITLE')}【后台】</title>
    <link href="__INSPINIA__/css/bootstrap.min.css" rel="stylesheet">
    <link href="__INSPINIA__/font-awesome/css/font-awesome.css" rel="stylesheet">
    <!-- Toastr style -->
    <link href="__INSPINIA__/css/plugins/toastr/toastr.min.css" rel="stylesheet">
    <!-- Gritter -->
    <link href="__INSPINIA__/js/plugins/gritter/jquery.gritter.css" rel="stylesheet">
    <link href="__INSPINIA__/css/animate.css" rel="stylesheet">
    <link href="__INSPINIA__/css/style.css" rel="stylesheet">

    <!-- Data Tables -->
    <link href="__INSPINIA__/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
    <link href="__INSPINIA__/css/plugins/dataTables/dataTables.responsive.css" rel="stylesheet">
    <link href="__INSPINIA__/css/plugins/dataTables/dataTables.tableTools.min.css" rel="stylesheet">
    <link href="__INSPINIA__/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__INSPINIA__/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">
   	<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
    <script type="text/javascript" src="__JS__/jquery.mousewheel.js"></script>
    <!-- <link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all"> -->
	<!-- <link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all"> -->
	<!--<link rel="stylesheet" type="text/css" href="__CSS__/{$Think.config.COLOR_STYLE}.css" media="all"> --> 
	<!-- UI Elements -->
    <link href="__INSPINIA__/css/plugins/chosen/chosen.css" rel="stylesheet">
    <link href="__INSPINIA__/css/plugins/colorpicker/bootstrap-colorpicker.min.css" rel="stylesheet">
    <link href="__INSPINIA__/css/plugins/cropper/cropper.min.css" rel="stylesheet">
    <link href="__INSPINIA__/css/plugins/switchery/switchery.css" rel="stylesheet">
    <link href="__INSPINIA__/css/plugins/jasny/jasny-bootstrap.min.css" rel="stylesheet">
    <link href="__INSPINIA__/css/plugins/nouslider/jquery.nouislider.css" rel="stylesheet">
    <link href="__INSPINIA__/css/plugins/datapicker/datepicker.css" rel="stylesheet">
    <link href="__INSPINIA__/css/plugins/ionRangeSlider/ion.rangeSlider.css" rel="stylesheet">
    <link href="__INSPINIA__/css/plugins/ionRangeSlider/ion.rangeSlider.skinFlat.css" rel="stylesheet">
    <link href="__INSPINIA__/css/plugins/clockpicker/clockpicker.css" rel="stylesheet">
    <link href="__INSPINIA__/css/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet">
	
    <block name="style"></block>
</head>
<body>
    <div id="wrapper">
        <nav class="navbar-default navbar-static-side" role="navigation">
            <div class="sidebar-collapse">
                <ul class="nav metismenu" id="side-menu">
                    <li class="nav-header">
                        <div class="profile-element"> 
                        	<span>
                            	<img height="60" width="60"  alt="image" class="img-circle" src="__ROOT__{:session('user_auth.userhead')}" />
                            </span>
                            <a data-toggle="dropdown" class="dropdown-toggle" href="#">
	                            <span class="clear"> 
		                            <span class="block m-t-xs">
		                            	<strong class="font-bold">{:session('user_auth.username')}</strong>
		                            </span>
		                            <span class="text-muted text-xs block">管理员 <b class="caret"></b>
		                            </span> 
	                            </span> 
                            </a>
                            <ul class="dropdown-menu animated fadeInRight m-t-xs">
                                <li><a href="{:U('User/updatePassword')}">修改密码</a></li>
                                <li><a href="{:U('User/updateNickname')}">修改昵称</a></li>
                                <li class="divider"></li>
                                <li><a href="{:U('Public/logout')}">注销</a></li>
                            </ul>
                        </div>
                        <div class="logo-element">管</div>
                    </li>
                    
					<!-- 动态添加菜单 -->
					<volist name="__MENU__.main" id="menu">
						<li>
			                <if condition="$menu.title eq '首页'">
								<a href="{:U('index/index')}"><i class="{$menu.iconcss}"></i> 
									<span class="nav-label">{$menu.title}</span>
								</a>
			                <else/>
				                <a href="#"><i class="{$menu.iconcss}"></i> 
									<span class="nav-label">{$menu.title}</span>
									<span class="fa arrow"></span>
								</a>
								<ul class="nav nav-second-level collapse">
					                <volist name="__MENU__.child" id="sub_menu">
					                    <!-- 子导航 -->
					                    <if condition="$menu.id eq $key"> 
				                            <volist name="sub_menu" id="menu2">
				                                <li id='{$menu.title}{$menu2.title}'>
													<a href='{$menu2.url|U}'>
														<i class="menu-icon fa fa-tachometer"></i>
														<span class="menu-text">{$menu2.title}</span>
													</a>
												</li>
				                            </volist>
				 						</if>
					                </volist>
					                <if condition="$menu.title eq '内容'"> 
									    <li>
					                        <a  href="{:U('article/mydocument')}" >
					                        <i class="menu-icon fa fa-tachometer"></i>
					                        <span class="menu-text">我的文档</span>
					                        </a>
					                    </li>
					                    <li>
					                        <a  href="{:U('article/draftbox')}" >
					                        <i class="menu-icon fa fa-tachometer"></i>
					                        <span class="menu-text">草稿箱</span>
					                        </a>
					                    </li>
					                    <li>
					                        <a  href="{:U('article/examine')}" >
					                        <i class="menu-icon fa fa-tachometer"></i>
					                        <span class="menu-text">待审核</span>
					                        </a>
					                    </li>
					                    <!-- 文章列表 -->
					                    <volist name="nodes" id="sub_menu">
									        <!-- 子导航 -->
									        <notempty name="sub_menu">
										        <li>
										        	<gt name="sub_menu['allow_publish']" value="0">
											        	<a href="{$sub_menu.url|U}">
											        		<i class="menu-icon fa fa-tachometer"></i>
											        		<span class="menu-text">{$sub_menu.title}</span>
											        	</a>
											        <else/>
											        	<a href="#">
											        		<i class="menu-icon fa fa-tachometer"></i>
											        		<span class="menu-text">{$sub_menu.title}</span>
											        		<span class="fa arrow"></span>
											        	</a>
										        	</gt>
					                                <ul class="nav nav-third-level">
						 								<volist name="sub_menu['_child']" id="menu">
										                    <li>
										                        <gt name="menu['allow_publish']" value="0">
										                        <a href="{$menu.url|U}">{$menu.title}</a>
										                        <else/>
										                        <a href="#">{$menu.title}</a>
										                        </gt>
										                    </li>
										                </volist>
					                                </ul>
					                            </li> 
									        </notempty>
									    </volist> 
			 						</if>
				                </ul>
			                </if>
		                </li>
		            </volist>
		            
                </ul>
            </div>
        </nav>
		<!-- /头部 --> 
		<div id="page-wrapper"  class="gray-bg dashbard-1">
			<div class="row border-bottom">
				<nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
					<div class="navbar-header">
						<button class="navbar-minimalize minimalize-styl-2 btn btn-primary dim ">
							<i class="fa fa-money"></i>
						</button>
						<ul class="nav navbar-top-links navbar-left">
				            <li><a href="#">{:C('WEB_SITE_TITLE')}后台管理</a></li>
				        </ul>
					</div>
					<ul class="nav navbar-top-links navbar-right">
						<li>
							<span class="m-r-sm text-muted welcome-message"><small>欢迎您,</small>{:session('user_auth.username')}</span>
						</li>
						<li>
							<a href="{:U('Public/logout')}">
								<i class="fa fa-sign-out btn btn-primary"></i> 注销
							</a>
						</li>
					</ul>
				</nav>
			</div>
			<!-- /头部 --> 
			<!-- 主体 -->
			<block name="breadcrumb"></block>
<!-- 			<div class="row no-margin">
				<div id="top-alert" class="alert alert-danger" style="left:0px;right:0px;top:0px;bottom:0px;display: none;">
		            <button type="button" class="close ajax-post" data-dismiss="alert">
						<i class="fa fa-times"></i>
					</button> 
		            <label class="alert-content">这是内容</label>						             
		        </div>
	        </div> -->
			<block name="body"></block>
			<!-- /主体 -->
			<!-- 底部 -->
			<div class="footer" >
			    <div class="pull-right">
			       	备案号<strong>{:C('WEB_SITE_ICP')}</strong>
			    </div>
			    <div><strong>版权所有</strong> {:C('COMPANY_CONFIG_NAME')} &copy;2015</div>
			</div>
			<!-- /底部 -->
		</div>
    </div>
	<!-- basic scripts -->
    <script type="text/javascript">
	    (function(){
	        var ThinkPHP = window.Think = {
	            "ROOT"   : "__ROOT__", //当前网站地址
	            "APP"    : "__APP__", //当前项目地址
	            "PUBLIC" : "__PUBLIC__", //项目公共目录地址
	            "DEEP"   : "{:C('URL_PATHINFO_DEPR')}", //PATHINFO分割符
	            "MODEL"  : ["{:C('URL_MODEL')}", "{:C('URL_CASE_INSENSITIVE')}", "{:C('URL_HTML_SUFFIX')}"],
	            "VAR"    : ["{:C('VAR_MODULE')}", "{:C('VAR_CONTROLLER')}", "{:C('VAR_ACTION')}"]
	        }
	    })();
	  
	</script>
    <script type="text/javascript" src="__STATIC__/think.js"></script>
    <script type="text/javascript" src="__JS__/common.js"></script>
    <!-- Mainly scripts -->
    <script src="__INSPINIA__/js/jquery-2.1.1.js"></script>
    <script src="__INSPINIA__/js/bootstrap.min.js"></script>
    <script src="__INSPINIA__/js/plugins/metisMenu/jquery.metisMenu.js"></script>
    <script src="__INSPINIA__/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>

    <!-- Flot -->
    <script src="__INSPINIA__/js/plugins/flot/jquery.flot.js"></script>
    <script src="__INSPINIA__/js/plugins/flot/jquery.flot.tooltip.min.js"></script>
    <script src="__INSPINIA__/js/plugins/flot/jquery.flot.spline.js"></script>
    <script src="__INSPINIA__/js/plugins/flot/jquery.flot.resize.js"></script>
    <script src="__INSPINIA__/js/plugins/flot/jquery.flot.pie.js"></script>

    <!-- Peity -->
    <script src="__INSPINIA__/js/plugins/peity/jquery.peity.min.js"></script>
    <script src="__INSPINIA__/js/demo/peity-demo.js"></script>

    <!-- Custom and plugin javascript -->
    <script src="__INSPINIA__/js/inspinia.js"></script>
    <script src="__INSPINIA__/js/plugins/pace/pace.min.js"></script>
    <!-- Data Tables -->
    <script src="__INSPINIA__/js/plugins/dataTables/jquery.dataTables.js"></script>
    <script src="__INSPINIA__/js/plugins/dataTables/dataTables.bootstrap.js"></script>
    <script src="__INSPINIA__/js/plugins/dataTables/dataTables.responsive.js"></script>
    <script src="__INSPINIA__/js/plugins/dataTables/dataTables.tableTools.min.js"></script>
    <!-- jQuery UI -->
    <script src="__INSPINIA__/js/plugins/jquery-ui/jquery-ui.min.js"></script>

    <!-- GITTER -->
    <script src="__INSPINIA__/js/plugins/gritter/jquery.gritter.min.js"></script>

    <!-- Sparkline -->
    <script src="__INSPINIA__/js/plugins/sparkline/jquery.sparkline.min.js"></script>

    <!-- Sparkline demo data  -->
    <script src="__INSPINIA__/js/demo/sparkline-demo.js"></script>

    <!-- ChartJS-->
    <script src="__INSPINIA__/js/plugins/chartjs/Chart.min.js"></script>

    <!-- Toastr提示框 -->
    <script src="__INSPINIA__/js/plugins/toastr/toastr.min.js"></script>
    <!-- Chosen下拉框 -->
    <script src="__INSPINIA__/js/plugins/chosen/chosen.jquery.js"></script>
    <!-- JSKnob -->
    <script src="__INSPINIA__/js/plugins/jsKnob/jquery.knob.js"></script>
    <!-- Input Mask-->
    <script src="__INSPINIA__/js/plugins/jasny/jasny-bootstrap.min.js"></script>
    <!-- Data picker日期选择框 -->
    <script src="__INSPINIA__/js/plugins/datapicker/bootstrap-datepicker.js"></script>
    <script src="__INSPINIA__/js/plugins/datapicker/bootstrap-datetimepicker.js"></script>
    <script src="__INSPINIA__/js/plugins/datapicker/bootstrap-timepicker.js"></script>
    <!-- NouSlider -->
    <script src="__INSPINIA__/js/plugins/nouslider/jquery.nouislider.min.js"></script>
    <!-- Switchery -->
    <script src="__INSPINIA__/js/plugins/switchery/switchery.js"></script>
    <!-- IonRangeSlider -->
    <script src="__INSPINIA__/js/plugins/ionRangeSlider/ion.rangeSlider.min.js"></script>
    <!-- iCheck -->
    <script src="__INSPINIA__/js/plugins/iCheck/icheck.min.js"></script>
    <!-- Color picker -->
    <script src="__INSPINIA__/js/plugins/colorpicker/bootstrap-colorpicker.min.js"></script>
    <!-- Clock picker -->
    <script src="__INSPINIA__/js/plugins/clockpicker/clockpicker.js"></script>
    <!-- Image cropper -->
    <script src="__INSPINIA__/js/plugins/cropper/cropper.min.js"></script>
    <!-- Date range use moment.js same as full calendar plugin -->
    <script src="__INSPINIA__/js/plugins/fullcalendar/moment.min.js"></script>
    <!-- Date范围选择 -->
    <script src="__INSPINIA__/js/plugins/daterangepicker/daterangepicker.js"></script>
    <script>
    	jQuery(function($) {
    		window.updateAlert = function (text,c) {
    			   if(c==null||c=='undefined')
   				   {
    		           setTimeout(function() {
       		               toastr.options = {
       		                   closeButton: true,
       		                   progressBar: true,
       		                   showMethod: 'slideDown',
       		                   timeOut: 1000
       		               };
       		               toastr.error(text,'提示');
       		           }, 100);
   				   }else
 				   {
    		           setTimeout(function() {
       		               toastr.options = {
       		                   closeButton: true,
       		                   progressBar: true,
       		                   showMethod: 'slideDown',
       		                   timeOut: 1000
       		               };
       		               toastr.success(text,'提示');
       		           }, 100);
 				   }

    		};
        });
    	var updateAlert = function (text,c) {
    		
    			 
			   if(c==null||c=='undefined'||c=='alert-error')
			   {
	           		setTimeout(function() {
  		               toastr.options = {
  		                   closeButton: true,
  		                   progressBar: true,
  		                   showMethod: 'slideDown',
  		                   timeOut: 1000
  		               };
  		               toastr.error(text,'提示');
  		           }, 100);
			   }else
			   {
	           		setTimeout(function() {
  		               toastr.options = {
  		                   closeButton: true,
  		                   progressBar: true,
  		                   showMethod: 'slideDown',
  		                   timeOut: 1000
  		               };
  		               toastr.success(text,'提示');
  		           }, 100);
			   }

		};
        //显示表格
        function showAsDataTables(id)
        {
        	$('.'+id).dataTable({
	            responsive: true,
	            "dom": 'T<"clear">lfrtip',
	            "bFilter":true,
	            "bInfo":true,
	            "bLengthChange":false,//是否允许终端用户从一个选择列表中选择分页的页数
	            "bScrollInfinite":false,
	            "bSort":false,
	            "bSortClasses":false,
	            "tableTools": {
	                "sSwfPath": "js/plugins/dataTables/swf/copy_csv_xls_pdf.swf"
	            },
	            "oLanguage":{
	                 "oAria":{
	                     "sSortAscending": " - click/return to sort ascending",
	                     "sSortDescending": " - click/return to sort descending"
	                 },
	                 "oPaginate": {
	                     "sFirst": "首页",
	                     "sLast": "尾页",
	                     "sNext": "上页",
	                     "sPrevious": "下页"
	                 },
	                 "sEmptyTable": "无数据",
	                 "sInfo": "总共 _TOTAL_条(_START_ ~ _END_)",
	                 "sInfoEmpty": "无记录可以展示",
	                 "sInfoFiltered": " - 从_MAX_条记录中过滤",
	                 //"sInfoPostFix": "所有数据已获取.",
	                 "sInfoThousands": "'",
	                 "sLengthMenu": "显示 _MENU_ 条",
	                 "sLoadingRecords": "请稍等 - 加载中...",
	                 "sProcessing": "数据正忙",
	                 "sSearch": "附加过滤条件： _INPUT_",
	                 "sUrl": "http://www.sprymedia.co.uk/dataTables/lang.txt",
	                 "sZeroRecords": "无记录可以展示"
	             }
	        });
        }
        function submitform(formname)
    	{
        	$(formname).submit(function(){ 
        		var self = $(this);
        		$.post(self.attr("action"), self.serialize(), success, "json");
        		return false;
        		function success(data){
        			if(data.status){
        				setTimeout(function() {
        		               toastr.options = {
        		                   closeButton: true,
        		                   progressBar: true,
        		                   showMethod: 'slideDown',
        		                   timeOut: 4000
        		               };
        		               toastr.success(data.info,'提示');
        		               window.location.href = data.url;
        		        }, 1000);
        				
        			} else {
       		           setTimeout(function() {
       		               toastr.options = {
       		                   closeButton: true,
       		                   progressBar: true,
       		                   showMethod: 'slideDown',
       		                   timeOut: 4000
       		               };
       		               toastr.error(data.info,'提示');
       		           }, 1000);
        			}
        		}
        	});
    	}
        
    </script>
    <block name="script"></block>
</body>
</html>
